package com.ehotting.edsta.diagnosisPredict.feign;

import com.ehotting.eaf.core.web.domain.diagnosisPredict.PageDto;
import com.ehotting.eaf.core.web.domain.diagnosisPredict.Response;
import com.ehotting.edsta.diagnosisPredict.domain.dto.FeLine;
import com.ehotting.edsta.diagnosisPredict.feign.factory.FeLineFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 算子连接线段FeignClient
 */
@FeignClient(name = "feLine", url = "${request.url.prefix}/feLine",fallbackFactory = FeLineFallbackFactory.class)
public interface FeLineFeignService {

    /**
     * 根据id批量删除,逗号分隔ps:'1,2,3”，关联子表删除请重写
     * @return
     */
    @PostMapping(value = "/deLeteByIds")
    Response<String> deLeteByIds(@RequestParam("ids") String ids);

    /**
     * 根据id查询
     * @return
     */
    @GetMapping(value = "/getById")
    Response<FeLine> getById(@RequestParam("id") Long id);

    /**
     * 列表
     * @return
     */
    @GetMapping(value = "/list")
    Response<List<FeLine>> list(@RequestParam("canvasId") Long canvasId,
                                @RequestParam("cid") Long cid,
                                @RequestParam("createTime") String createTime,
                                @RequestParam("id") Long id,
                                @RequestParam("lineParams") String lineParams,
                                @RequestParam("pid") Long pid);

    /**
     * 分页列表
     * @return
     */
    @GetMapping(value = "/pageList")
    Response<PageDto<FeLine>> pageList(@RequestParam("canvasId") Long canvasId,
                                       @RequestParam("cid") Long cid,
                                       @RequestParam("createTime") String createTime,
                                       @RequestParam("id") Long id,
                                       @RequestParam("lineParams") String lineParams,
                                       @RequestParam("pid") Long pid);

    /**
     * 保存
     * @return
     */
    @PostMapping(value = "/save")
    Response<FeLine> save(@RequestBody FeLine feLine);

    /**
     * 根据数据的id修改或不存在id就添加
     * @return
     */
    @PostMapping(value = "/saveOrUpdate")
    Response<String> saveOrUpdate(@RequestBody FeLine feLine);

    /**
     * 根据数据的id批量修改或不存在id就批量添加
     * @return
     */
    @PostMapping(value = "/saveOrUpdateBatch")
    Response<String> saveOrUpdateBatch(@RequestBody FeLine[] feLine);

    /**
     * 修改
     * @return
     */
    @PostMapping(value = "/update")
    Response<String> update(@RequestBody FeLine feLine);

    /**
     * 根据数据的id批量修改
     * @return
     */
    @PostMapping(value = "/updateList")
    Response<String> updateList(@RequestBody FeLine[] feLine);

}
